import requests
from TS.common.login import TinyShop
from TS.common.thisisurl import url
class add:
    # def __init__(self):
    #     self.s=requests.session()
    #     self.s.get("http://192.168.4.226/TinyShop_v1.7/index.php?con=admin&act=captcha&h=40&w=120&bc=3f4657&c=ffffff")
    #     data = {"name": "admin", "password": "123456", 'verifyCode': "aaaa"}
    #     self.url = "http://192.168.4.226/TinyShop_v1.7/index.php?con=admin&act=check"
    #     m = self.s.post(url=self.url, data=data)
    #     # print(m.text)
    def add(self,m):
        u=url()
        geturl=u.url()
        w=TinyShop()
        t,s=w.login({"name":"admin","password":"123456",'verifyCode': "aaaa"})
        # m={'name':'sasasds','password':'我们啊我们啊','repassword':'123456','email':'5师大82@qq.com','real_name':'sas'}
        add_url=geturl+"/index.php?con=customer&act=customer_save"
        x=s.post(url=add_url,data=m)
        # print(x.text)
        return x.text

if __name__=="__main__":
    a=add()
    a.add()